package com.mnt.gui.base.contorls.view;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.scene.control.Label;
import javafx.stage.Stage;

import com.mnt.gui.base.contorls.executer.DialogExecuter;
import com.mnt.gui.base.controller.BaseController;
import com.mnt.gui.base.util.FXMLLoaderTool;

/**
 * simple dialog view
 * @author cico
 *
 */
public class SimpleDialogController extends BaseController {
	
	private DialogExecuter executer;
	private Stage parentStage;
	public SimpleDialogController(DialogExecuter executer, Stage parentStage) {
		FXMLLoaderTool.load(this);
		this.executer = executer;
		this.parentStage = parentStage;
	}
	
    @FXML
    private Label lblContent;

    @FXML
    private Label lblTitle;


    public final void setTitle(String title) {
    	lblTitle.setText(title);
    }
    
 
    public final void setContent(String content) {
    	lblContent.setText(content);
    }
    
    
    
    @FXML
    private void processNO(ActionEvent event) {
    	executer.processCancel();
    	parentStage.close();
    }

    @FXML
    private void processOK(ActionEvent event) {
    	executer.processConfirm();
    	parentStage.close();
    }
    
}
